package com.yanqu.road.server.cmd.relatives;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.relatives.RelativesProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.relatives.RelativesMgr;
import com.yanqu.road.server.protocol.Protocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = Protocol.S_RELATIVES_CANCEL_BACK_FROM_CROSS, desc = "解除亲家（跨服)（返回）")
public class RelativesCancelBackFromCrossCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage yanQuMessage) throws Exception {

        RelativesProto.CrossCancelRelativesRespMsg reqMsg = RelativesProto.CrossCancelRelativesRespMsg.parseFrom(yanQuMessage.getBytes());
        RelativesMgr.cancelRelativesBackFromCross(reqMsg.getReq().getRelativesId(), reqMsg.getReq().getFromUserId(), reqMsg.getReq().getFromServerId());

    }
}
